<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/9/29
 * Time: 11:04
 */

namespace app\index\model;
use think\Model;
use think\Db;
class OrderGoods extends Model
{
    public function Goods(){
        return $this->hasOne('ShopGoods','goods_id','id');
    }

    public function getThumbAttr($value,$data){
        return Db::name('shop_goods')->where('id',$data['goods_id'])->value('thumb_img');
    }
}